<%--
  Created by IntelliJ IDEA.
  User: 唐东
  Date: 2021/1/19
  Time: 13:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="java.sql.*"%>
<%@ page import="com.tenton.*"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <title>Title</title>
</head>
<body style="background-color: pink">
    <h2 align="center">图书信息管理</h2>
    <hr>
    <table class="border_distance" width="800" align="center"  bgcolor="white">
        <thead>
        <tr>
            <form action="/selectBookByIdServlet" method="post">
                <td>
                    <input type="text" name="id" placeholder="输入图书id进行查询" />
                </td>
                <td align="center" colspan="9">
                    <input type="submit" value="查&nbsp;询"/>
                </td>
            </form>
        </tr>
        <tr bgcolor="#DB7093">
            <td align="center" width="30">商品id</td>
            <td align="center" width="80">商品缩图</td>
            <td align="center">商品摘要</td>
            <td align="center" width="100">信息修改</td>
            <td align="center">删除操作</td>
        </tr>
        </thead>
        <tbody>
            <c:forEach items="${requestScope.books}" var="book">
            <tr>
                <td style="width: 30px">${book.id}</td>
                <td style="width: 80px">
                    <img style="width: 30px;height: 50px" src="/images/${book.image}">
                </td>
                <td style="width: 130px">书名：${book.bookName}<br/>
                        作者：${book.author}<br/>
                        出版社：${book.press}<br/>
                        价格：${book.price}<br/>
                </td>
                <td style="width: 60px">
                    <a href="/toUpdateBookServlet?id=${book.id}">修改图书信息</a>
                </td>
                <td style="width: 60px">
                    <a href="/deleteBookServlet?id=${book.id}">删除图书信息</a>
                </td>
            </tr>
            </c:forEach>
            <tr align="center">
                <td colspan="5">
                    <a href="addBook.jsp">添加图书</a>
                </td>
            </tr>
        </tbody>
    </table>
</body>
</html>
